#ifndef IGAME_H_
#define IGAME_H_

#include <vector>

#include "../core/igame.hpp"
#include "../lan/command_connection.hpp"

#include "game_commands.hpp"
#include "space_ship.hpp"

namespace ps
{

class PixelShooterGame: public lge2d::IGame
{
public:
	PixelShooterGame();

	virtual void Initialize();

	virtual void Update(float dt);

	virtual void Render() const;

	virtual void OnEvent(const sf::Event& event);

	void SetWindow(sf::RenderWindow* window) {m_window = window;}


	// lan events
	void OnVersionCommand(const lan::VersionCommand& cmd);
	void OnErrorCommand(const lan::ErrorCommand& cmd);

private:
	std::vector<SpaceShip> m_space_ships;
	sf::RenderWindow* m_window;
	sf::Image m_ship_texture;
	lge2d::lan::CommandConnection m_cmd_connection;
	const int m_max_players;
};

} // namespace ps

#endif /* IGAME_H_ */
